package com.myexam.action;

import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.myexam.model.Subject;
import com.myexam.service.SubjectService;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope("prototype")
public class SubjectUpadateBeforeAction extends ActionSupport implements RequestAware {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9174261289182650268L;
	private Map<String, Object> request;
	private int subjectID;
	@Autowired
	private SubjectService subjectService;
	public Map<String, Object> getRequest() {
		return request;
	}
	public void setRequest(Map<String, Object> request) {
		this.request = request;
	}
	public int getSubjectID() {
		return subjectID;
	}
	public void setSubjectID(int subjectID) {
		this.subjectID = subjectID;
	}
	
	public String execute() throws Exception{
		Subject subject = subjectService.showSubjectParricular(subjectID);
		request.put("subject", subject);
		return SUCCESS;
	}

}
